/*
 * @Author: yuanchenxi 836909158@qq.com
 * @Date: 2024-07-24 16:57:31
 * @LastEditors: Wang Shuo wangshuo@sgsimulation.com
 * @LastEditTime: 2024-08-30 13:42:32
 * @FilePath: \SGFEM\DataStructure\FEM\Property\include\PBARData.h
 */
#pragma once
#include <vector>

#include "DataStructure/Common/DataStructureExport.h"
#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Property/PropertyBase.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
/** @brief 梁截面属性
 *
 * 直接给定截面属性值
 */
struct PBARData : public PropertyBase
{
    SG::DataStructure::Common::Id   m_mId      = 0;    ///< 材料属性Id
    SG::DataStructure::Common::Real m_A        = 0.0;  ///< 截面积
    SG::DataStructure::Common::Real m_I1       = 0.0;  ///< 惯性矩1
    SG::DataStructure::Common::Real m_I2       = 0.0;  ///< 惯性矩2
    SG::DataStructure::Common::Real m_J        = 0.0;  ///< 扭转常数
    SG::DataStructure::Common::Real m_NSM      = 0.0;  ///< 非结构质量
    SG::DataStructure::Common::Real m_FE       = 0.0;
    SG::DataStructure::Common::Real m_C1       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_C2       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_D1       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_D2       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_E1       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_E2       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_F1       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_F2       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_K1       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_K2       = 0.0;  ///< 应力恢复系数
    SG::DataStructure::Common::Real m_I12      = 0.0;  ///< 惯性积
    SG::DataStructure::Common::Id   m_domainId = 0;

    /// @brief 接收一个长度为8的vector，将其值赋值给m_C1~m_F2
    DECLSPEC void SetStressPoints (const std::vector<SG::DataStructure::Common::Real>& v);
};

/// @brief 判断单元数据是否相等
DECLSPEC bool operator== (const PBARData& a, const PBARData& b);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE